<template>
  <div class='container'>
    <el-dialog title="预览文章" :visible="preview" @close='close'>
      <!-- <div v-html="eye"></div> -->
      <div class="box1">
      <h2>{{eye.title}}</h2>
      <p>
        <span>{{eye.createTime | parseTimeByString()}}</span>
        <span>{{eye.username}}</span>
        <i class="el-icon-view"></i>
        <span>{{eye.visits}}</span>
      </p>
      </div>
     <div class="eye">
       <div v-html="eye.articleBody"></div>
     </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    eye: {
      type: Object,
      required: true
    },
    preview: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    close () {
      this.$emit('update:preview', false)
    }
  }
}
</script>

<style scoped lang='less'>
.box1{
  border-bottom: 1px dashed #ccc;
  span{
   margin-right: 10px;
  }
  i{
    margin-right: 5px;
  }
}
.eye{
  background: #f5f5f5;
  width: 720px;
  padding: 10px;
  ::v-deep{
    img{
    width: 100%;
  }
  }
}
</style>
